<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <link rel="stylesheet" href="styles/style.css">
        <link rel="stylesheet" href="styles/theme/atom-one-dark.css">
        <title>例子26-JS进阶（三）</title>
    </head>
    <body>
        <pre>
            <code>
                    // 例子26

                    var pattern = new RegExp("\\d{5}", "g"); // 全局匹配字符串中的5个数字，注意必须使用了"\\"进行斜杠的转义，以避免其变为普通的字符串
                    console.log(pattern.source); // \d{5}
                    console.log(pattern.global); // true
                    console.log(pattern.ignoreCase); // false
                    console.log(pattern.multiline); // false
                    console.log(pattern.lastIndex); //0
            </code>
        </pre>
        <script src="scripts/libs/highlight.pack.js"></script>
        <script src="scripts/26.js"></script>
        <script>
            hljs.initHighlightingOnLoad();
        </script>
    </body>
</html>